package com.edu.app.service.wechat;



import com.edu.app.service.impl.wechat.msgroute.WxMpMessageHandler;
import com.edu.app.service.impl.wechat.msgroute.consts.WxConsts;
import com.edu.app.service.impl.wechat.msgroute.session.WxSessionManager;
import com.edu.app.service.sys.wechat.WechatBaseService;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by qianjia on 15/1/22.
 */
public class DemoTextHandler implements WxMpMessageHandler {
  @Override
  public Map<String,String> handle(Map<String,String> wxMessage, Map<String, Object> context,
                                   WechatBaseService wxMpService, WxSessionManager sessionManager) {
//    WxMpXmlOutTextMessage m
//      = WxMpXmlOutMessage.TEXT().content("测试加密消息").fromUser(wxMessage.getToUser())
//      .toUser(wxMessage.getFromUser()).build();
//    return m;

    Map<String,String> map = new HashMap<>();
    map.put(WxConsts.MsgField.Content,"测试文本消息");
    map.put(WxConsts.MsgField.FromUserName,wxMessage.get(WxConsts.MsgField.ToUserName));
    return map;

  }

}
